#include "setvipdata.h"
#include "ui_setvipdata.h"
#include <QDebug>
#include <carmainwindow.h>
SetVipData::SetVipData(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::SetVipData)
{
    ui->setupUi(this);

    QPixmap pimax = QPixmap("3.bmp");
    pimax = pimax.scaled(ui->label_pay->size());
    ui->label_pay->setPixmap(pimax);

}
SetVipData::~SetVipData()
{
    delete ui;
}


void SetVipData::set_vip_data(QString carId, QString enterTimeStr, QString lastTime, int secs, double vipmoney)
{
    ui->textBrowser->append("车牌号：");
    ui->textBrowser->append(carId);
    ui->textBrowser->append("进场时间：");
    ui->textBrowser->append(enterTimeStr);
    ui->textBrowser->append("离场时间：");
    ui->textBrowser->append(lastTime);
    ui->textBrowser->append("停车时长(秒)：");
    ui->textBrowser->append(QString::number(secs));
    ui->textBrowser->append("停车费用(元)：");
    ui->textBrowser->append(QString::number( vipmoney));

    QString All = QString("停车时长：%1秒 - 停车费用：%2元").arg(QString::number(secs)).arg(QString::number( vipmoney));
    ui->lineEdit->setText(All);

}

void SetVipData::on_pushButton_clicked()
{
    //获取父窗口指针
    CarMainWindow *parent = dynamic_cast<CarMainWindow*>(this->parentWidget());
    parent->show();
    this->close();
}
